# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionCustomVariable do
  @moduledoc """
  A conversion custom variable. See "About custom Floodlight metrics and dimensions in the new Search Ads 360" at https://support.google.com/sa360/answer/13567857

  ## Attributes

  *   `cardinality` (*type:* `String.t`, *default:* `nil`) - Output only. Cardinality of the conversion custom variable.
  *   `customColumnIds` (*type:* `list(String.t)`, *default:* `nil`) - Output only. The IDs of custom columns that use this conversion custom variable.
  *   `family` (*type:* `String.t`, *default:* `nil`) - Output only. Family of the conversion custom variable.
  *   `floodlightConversionCustomVariableInfo` (*type:* `GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionCustomVariable_FloodlightConversionCustomVariableInfo.t`, *default:* `nil`) - Output only. Fields for Search Ads 360 floodlight conversion custom variables.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Output only. The ID of the conversion custom variable.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. The name of the conversion custom variable. Name should be unique. The maximum length of name is 100 characters. There should not be any extra spaces before and after.
  *   `ownerCustomer` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the customer that owns the conversion custom variable.
  *   `resourceName` (*type:* `String.t`, *default:* `nil`) - Immutable. The resource name of the conversion custom variable. Conversion custom variable resource names have the form: `customers/{customer_id}/conversionCustomVariables/{conversion_custom_variable_id}`
  *   `status` (*type:* `String.t`, *default:* `nil`) - The status of the conversion custom variable for conversion event accrual.
  *   `tag` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. The tag of the conversion custom variable. Tag should be unique and consist of a "u" character directly followed with a number less than ormequal to 100. For example: "u4".
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cardinality => String.t() | nil,
          :customColumnIds => list(String.t()) | nil,
          :family => String.t() | nil,
          :floodlightConversionCustomVariableInfo =>
            GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionCustomVariable_FloodlightConversionCustomVariableInfo.t()
            | nil,
          :id => String.t() | nil,
          :name => String.t() | nil,
          :ownerCustomer => String.t() | nil,
          :resourceName => String.t() | nil,
          :status => String.t() | nil,
          :tag => String.t() | nil
        }

  field(:cardinality)
  field(:customColumnIds, type: :list)
  field(:family)

  field(:floodlightConversionCustomVariableInfo,
    as:
      GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionCustomVariable_FloodlightConversionCustomVariableInfo
  )

  field(:id)
  field(:name)
  field(:ownerCustomer)
  field(:resourceName)
  field(:status)
  field(:tag)
end

defimpl Poison.Decoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionCustomVariable do
  def decode(value, options) do
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionCustomVariable.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_ConversionCustomVariable do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
